import java.util.concurrent.TimeUnit;

public class thre {
    public static void main(String[] args) throws InterruptedException {
        var th = new thre();
        var t1 = new Thread(th::work, "T1");
        var t2 = new Thread(th::work, "T2");
        var t3 = new Thread(th::work, "T3");
        var t4 = new Thread(th::work, "T4");
        t1.start();
        t2.start();
        t3.start();
        t3.join(0);
        t4.start();
    }

    void work() {
        String tn = Thread.currentThread().getName();
        for (int i = 0; i < 5; i++) {
            try {
                TimeUnit.SECONDS.sleep(1);
            } catch (Exception e) {
                e.printStackTrace();
            }
            System.out.printf("%s=%d%n", tn, i);
        }
    }
}
